package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:05:00
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemProperty implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysPropertyDAO.Id);

        mappedDaoFields.put("propertyCatalog",
            com.ourteam.system.dao.ISysPropertyDAO.PropertyCatalog);

        mappedDaoFields.put("propertyCode",
            com.ourteam.system.dao.ISysPropertyDAO.PropertyCode);

        mappedDaoFields.put("propertyName",
            com.ourteam.system.dao.ISysPropertyDAO.PropertyName);

        mappedDaoFields.put("propertyValue",
            com.ourteam.system.dao.ISysPropertyDAO.PropertyValue);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysPropertyDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysPropertyDAO.Remarks);
    }

    private com.ourteam.system.dao.SysProperty sysProperty;

    public SystemProperty() {
        super();

        this.sysProperty = new com.ourteam.system.dao.SysProperty();
    }

    public SystemProperty(com.ourteam.system.dao.SysProperty sysProperty) {
        super();

        this.sysProperty = sysProperty;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysProperty);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysProperty convertToSysProperty() {
        return this.sysProperty;
    }

    public com.ourteam.system.dao.SysProperty convertTo() {
        return this.sysProperty;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysProperty.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysProperty.setId(id);
    }

    /**
     * Get propertyCatalog
     *
     * @return String
     */
    public String getPropertyCatalog() {
        return (String) this.sysProperty.getPropertyCatalog();
    }

    /**
     * Set propertyCatalog
     *
     * @parameter String
     */
    public void setPropertyCatalog(String propertyCatalog) {
        this.sysProperty.setPropertyCatalog(propertyCatalog);
    }

    /**
     * Get propertyCode
     *
     * @return String
     */
    public String getPropertyCode() {
        return (String) this.sysProperty.getPropertyCode();
    }

    /**
     * Set propertyCode
     *
     * @parameter String
     */
    public void setPropertyCode(String propertyCode) {
        this.sysProperty.setPropertyCode(propertyCode);
    }

    /**
     * Get propertyName
     *
     * @return String
     */
    public String getPropertyName() {
        return (String) this.sysProperty.getPropertyName();
    }

    /**
     * Set propertyName
     *
     * @parameter String
     */
    public void setPropertyName(String propertyName) {
        this.sysProperty.setPropertyName(propertyName);
    }

    /**
     * Get propertyValue
     *
     * @return String
     */
    public String getPropertyValue() {
        return (String) this.sysProperty.getPropertyValue();
    }

    /**
     * Set propertyValue
     *
     * @parameter String
     */
    public void setPropertyValue(String propertyValue) {
        this.sysProperty.setPropertyValue(propertyValue);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysProperty.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysProperty.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysProperty.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysProperty.setRemarks(remarks);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemProperty) == false) {
            return false;
        } // end if

        SystemProperty other = (SystemProperty) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysProperty tempSysProperty = other.convertToSysProperty();

        if ((tempSysProperty == null) || (this.sysProperty == null)) {
            isEqual = false;
        } else if ((tempSysProperty == this.sysProperty) ||
                tempSysProperty.equals(this.sysProperty)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemProperty[] toArray(
        com.ourteam.system.dao.SysProperty[] aSysPropertys) {
        return toArray(aSysPropertys, null);
    }

    public static SystemProperty[] toArray(
        com.ourteam.system.dao.SysProperty[] aSysPropertys,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysPropertys)) {
            return new SystemProperty[0];
        }

        int length = aSysPropertys.length;

        SystemProperty[] beans = new SystemProperty[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemProperty(aSysPropertys[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysPropertys[i] });
            }
        }

        return beans;
    }
}
